package Gameplay 
{
	import flash.display.Sprite;
	
	public class GridSelector extends Sprite 
	{
		protected var FSizeX:int;
		protected var FSizeY:int;
		protected var FSize:Number;
		protected var FColor:uint;		
		
		public function GridSelector():void 
		{
			super();
			FSizeX = 1;
			FSizeY = 1;
			FSize = new Number();
			FColor = 0xFFFFFF;
			alpha = 0.5;
		}
		
		protected function Redraw():void
		{
			var vWidth:Number = new Number(FSize * FSizeX);
			var vHeight:Number = new Number(vWidth / 2 * FSizeY);
			graphics.clear();
			graphics.beginFill(FColor);			
			graphics.moveTo(0, vHeight / 2);
			graphics.lineTo(vWidth / 2, 0);
			graphics.lineTo(vWidth, vHeight / 2);
			graphics.lineTo(vWidth / 2, vHeight);
			graphics.lineTo(0, vHeight / 2);
			graphics.endFill();
		}
		
		public function set Color(AColor:uint):void
		{
			FColor = AColor;
			Redraw();
		}
		
		public function set Size(ASize:uint):void
		{
			FSize = ASize;
			Redraw();
		}
	}
}